﻿$(document).ready(function () {

    $("#btnGoodsSlideshowSave").bind("click", btnGoodsSlideshowSave)
});
function btnGoodsSlideshowSave() {
    var GoodsID = $("#txtGoodsID").val();
    var txtUpdateGoodsName = $("#txtUpdateGoodsName").val();
    if (GoodsID == null || GoodsID == undefined) {
        art.dialog
    ({
        title: '系统提示',
        content: ("请重新登陆！"),
        lock: true
    });

        return false;
    }
    doAjax(
    "../",
    "GoodsSlideshowSave",
    {
        "GoodsID": GoodsID,
        "strImg": txtUpdateGoodsName
    },
    "json",
     function (json) {
         switch (json) {
             case -3:
                 art.dialog
                      ({
                          title: '系统提示',
                          time: 4,
                          content: ("系统错误 请与系统管理员联系！"),
                          lock: true
                      });
                 break;
             default:
                 art.dialog({
                     title: '系统提示',
                     time: 0.5,
                     content: '添加成功！',
                     close: function () { window.location.reload(); },
                     lock: true
                 });
                 
                 break;
         }
     })
}
function btnGoodsSlideshowDel(GoodsSlideshowID) {
    doAjax(
"../",
"GoodsSlideshowDel",
{
    "GoodsSlideshowID": GoodsSlideshowID
},
"json",
 function (json) {
     switch (json) {
         case -3:
             art.dialog
                  ({
                      title: '系统提示',
                      time: 4,
                      content: ("系统错误 请与系统管理员联系！"),
                      lock: true
                  });
             break;
         default:
             window.location.reload();
             break;
     }
 })
}
function ShowPic(path) {

    if (path != "" && path != "../Upload/MicroWebsite/MicroWebsiteSymbol/") {
        var image = "<img src='" + path + "' onerror=\"this.src='../images/Gift/nogift.jpg'\" width=\"379\" height=\"500\" />";
    }
    else {
        var image = "<img src='../images/Gift/nogift.jpg' onerror=\"this.src='../images/Gift/nogift.jpg'\" width=\"379\" height=\"500\" />";
    }
    art.dialog({
        padding: 0,
        title: '产品',
        content: image,
        lock: true,
        width: 300,
        height: 300
    });
}